package org.example.back.controller.healthassistant;

import org.example.back.entity.healthassistant.HealthRequest;
import org.example.back.entity.healthassistant.HealthResponse;
import org.example.back.service.healthassistant.HealthAssistantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/assist")
public class HealthAssistantController {

    @Autowired
    private HealthAssistantService assistantService;

    @PostMapping("/ask")
    public HealthResponse askQuestion(@RequestBody HealthRequest request) {
        String reply = assistantService.getAnswerFromLLM(request.getQuestion());
        return new HealthResponse(reply);
    }
}
